@import './variable.scss', './size.scss', './theme.scss';

// 样式重置
#app-main {
  overflow: hidden;
}

.page {
  height: 100%;
}

.navbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 0 12px;
}

// 右键
.n-dropdown-menu {
  .n-dropdown-option-body {
    height: 40px !important;
    display: flex;
    align-items: center;
  }
}

.right-click {
  border: none !important;

  .menu-item {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 10px;
    color: var(--color-black);

    img {
      width: 20px;
      height: 20px;
      margin-right: 10px;
    }
  }
}

// 滚动条
.scroll-bar {
  overflow: auto;

  &::-webkit-scrollbar {
    width: 5px;
    height: 5px;
  }

  &::-webkit-scrollbar-thumb {
    background-color: rgba($color: #000000, $alpha: 0.2);
  }
}

// 自定义弹窗
.kang-modal {
  padding: 15px;
  border-radius: 12px;

  .n-dialog__title {
    padding-bottom: 10px;

    .n-dialog__icon {
      display: none;
    }
  }

  .n-dialog__close {
    margin: 0;
    padding: 20px;
    transform: translateY(7px);
  }

  .n-dialog__content {
    margin: 0;
  }
}

.kang-drawer {
  .n-drawer-header {
    border: none;
  }

  .n-drawer-body {
  }
}

// 原型头像
.kang-avatar {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;

  &.radius {
    border-radius: var(--border-radius);
  }

  &.large {
    width: 55px;
    height: 55px;
  }
}

// 遮罩
.n-modal-mask {
  background-color: rgba($color: #000000, $alpha: 0.3);
}

// 提交按钮
.submit-btn {
  width: 200px;
  height: 42px;
  border-radius: 8px;
}

.n-input {
  overflow: hidden;

  &.kang-input--normal {
    --n-border-hover: transparent !important;
    --n-border-focus: transparent !important;
    background-color: transparent !important;

    .n-input-wrapper {
      padding: 0;
    }

    .n-input__border {
      display: none;
    }
  }
}

// 消息红点
.red-dot {
  position: absolute;
  min-width: 15px;
  height: 15px;
  line-height: 15px;
  font-size: 10px;
  color: var(--color-white);
  background-color: var(--color-error);
  z-index: 10;
  font-style: unset;
  border-radius: 50%;
  text-align: center;

  &.silent {
    display: none;
  }
}

// 布局
.flex {
  display: flex;
}

@for $i from 1 to 13 {
  .flex-#{$i} {
    flex-grow: #{$i};
  }
}

.flex-fs-0 {
  flex-shrink: 0;
}

.flex-col {
  flex-flow: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-rl {
  justify-content: flex-start;
}

.flex-rc {
  justify-content: center;
}

.flex-rr {
  justify-content: flex-end;
}

.flex-rb {
  justify-content: space-between;
}

.flex-ct {
  align-items: flex-start;
}

.flex-cc {
  align-items: center;
}

.flex-cb {
  align-items: flex-end;
}

.flex-center {
  @extend .flex-rc, .flex-cc;
}

// 点击反馈
.hover {
  &:hover {
    background-color: var(--color-active) !important;
  }

  &--error {
    &:hover {
      color: var(--color-white) !important;
      background-color: var(--color-error) !important;
    }
  }
}

.click {
  cursor: pointer;

  &:active {
    background-color: var(--color-active-2) !important;
  }
}

// 圆角
.radius {
  border-radius: var(--border-radius);
  overflow: hidden;
}

.round {
  border-radius: 50%;
  overflow: hidden;
}

// 文字
@for $i from 1 to 10 {
  .fw-#{$i * 100} {
    font-weight: $i * 100;
  }
}

.fw-thin {
  font-weight: 200;
}

.fw-bold {
  font-weight: bolder;
}

.td-under {
  text-decoration: underline;
}

.td-del {
  text-decoration: line-through;
}

.lh-1 {
  line-height: 1;
}

.lh-2 {
  line-height: 2;
}

@for $i from 10 to 101 {
  .fz-#{$i} {
    font-size: $i * 1px;
  }
}

.hide-1-new {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@for $i from 1 to 6 {
  .hide-#{$i} {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: $i;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

// 对齐
.ta-left {
  text-align: left;
}

.ta-center {
  text-align: center;
}

.ta-right {
  text-align: right;
}

.ta-between {
  text-align: justify;
  text-align-last: justify;
}

.va-top {
  vertical-align: top;
}

.va-center {
  vertical-align: middle;
}

.va-bottom {
  vertical-align: bottom;
}

// 边距
@for $i from 0 to 41 {
  @each $word, $key in 't' 'top', 'r' 'right', 'b' 'bottom', 'l' 'left',
    'all' 'all'
  {
    @if ($key != 'all') {
      .m#{$word}-#{$i * 5} {
        margin-#{$key}: $i * 5 * 1px !important;
      }

      .p#{$word}-#{$i * 5} {
        padding-#{$key}: $i * 5 * 1px !important;
      }
    } @else {
      .m-#{$i * 5} {
        margin: $i * 5 * 1px;
      }

      .p-#{$i * 5} {
        padding: $i * 5 * 1px;
      }
    }
  }
}

// 边框
@each $key in 'top', 'right', 'bottom', 'left', 'all' {
  @if ($key != 'all') {
    .bd-#{$key} {
      border-#{$key}: 1px solid var(--color-border);

      &.bold {
        border-width: 5px;
        border-color: var(--color-bg);
      }
    }
  } @else {
    .bd {
      border: 1px solid var(--color-border);

      &.bold {
        border-width: 5px;
        border-color: var(--color-bg);
      }
    }
  }
}

// 阴影
.sd {
  box-shadow: 0 0 10px 1px var(--color-active);
}

.sd-top {
  box-shadow: 0 -10px 10px -10px var(--color-active);
}

.sd-right {
  box-shadow: 10px 0 10px -10px var(--color-active);
}

.sd-bottom {
  box-shadow: 0 10px 10px -10px var(--color-active);
}

.sd-left {
  box-shadow: -10px 0 10px -10px var(--color-active);
}

// 定位
.rel {
  position: relative;
  z-index: 1;
}
